nodemailer = require("nodemailer")

smtpTransport = nodemailer.createTransport "SMTP",  
	service: "QQ"
	auth: {
		user: "thoughtcrime@qq.com"
		pass: "ab321321"
	}

module.exports = 
	error: (err)->
		errfile =  module.parent.filename
		smtpTransport.sendMail
			from:  "thoughtcrime@qq.com"
			to:"369600584@qq.com"
			subject: errfile
			text: err.stack ? err || require('util').inspect err
		,(err)->
			console.log err if err
